package com.cskaoyan.catmall.controller.wx;

import com.cskaoyan.catmall.model.vo.BaseRespVo;
import com.cskaoyan.catmall.model.vo.CatalogCurrentWxVO;
import com.cskaoyan.catmall.model.vo.CatalogIndexWxVO;
import com.cskaoyan.catmall.service.CatalogServiceWx;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @date: 2022-01-10-19-29
 * @author: ZYY
 * @description: 前台目录接口的Controller
 */
@RestController
@RequestMapping("wx")
public class CatalogControllerWx {
    @Autowired
    CatalogServiceWx catalogServiceWx;

    /**
     * @author:zyy
     * @description: 前台目录的显示接口
     * @date:2022/01/10 19:33
     * @param id
     * @return com.cskaoyan.catmall.model.vo.BaseRespVo
     */
    @RequestMapping("catalog/current")
    public BaseRespVo catalogCurrent(Integer id){
        CatalogCurrentWxVO data = catalogServiceWx.catalogCurrent(id);
        return BaseRespVo.ok(data);
    }

    /**
     * @author:zyy
     * @description: 前台目录的显示接口
     * @date:2022/01/10 22:35
     * @return com.cskaoyan.catmall.model.vo.BaseRespVo
     */
    @RequestMapping("catalog/index")
    public BaseRespVo catalogIndex(){
        CatalogIndexWxVO data = catalogServiceWx.catalogIndex();
        return BaseRespVo.ok(data);
    }
}